#!/usr/bin/python3
# author luke
# 2024年03月06日下午 1:38
from typing import List


class Solution(object):
    def fizzBuzz(self, n):
        """
        :type n: int
        :rtype: List[str]
        """

        fb = []
        for i in range(1, n + 1):
            if i % 3 == 0 and i % 5 == 0:
                fb.append("FizzBuzz")
            elif i % 3 == 0 and i % 5 != 0:
                fb.append("Fizz")
            elif i % 5 == 0 and i % 3 != 0:
                fb.append("Buzz")
            else:
                fb.append(str(i))
        return fb

    def fizzBuzz_1(self, n: int) -> List[str]:
        ans = []
        for i in range(1, n + 1):
            s = ""
            if i % 3 == 0:
                s += "Fizz"
            if i % 5 == 0:
                s += "Buzz"
            if s == "":
                s = str(i)
            ans.append(s)
        return ans


if __name__ == '__main__':
    # n = 3
    # n=5
    n = 15
    sou = Solution()
    # print(sou.fizzBuzz(n))
    print(sou.fizzBuzz_1(n))

    """输入：n = 3
输出：["1","2","Fizz"]

输入：n = 5
输出：["1","2","Fizz","4","Buzz"]

输入：n = 15
输出：["1","2","Fizz","4","Buzz","Fizz","7","8","Fizz","Buzz","11","Fizz","13","14","FizzBuzz"]"""
